const mongoose = require('mongoose');

const UserSchema = new mongoose.Schema({
  username: { type: String, required: true, unique: true },
  avatar: { type: String, required: false },
  phone: { type: String, required: true, unique: true },
  password: { type: String, required: true },
  school: { type: String, required: false },
  clubs: { type: [String], required: false },
  gender: { type: String, required: false },
  birthday: { type: Date, required: false },
  registration_time: { type: Date, default: Date.now },
  signature: { type: String, required: false }
});

module.exports = mongoose.model('User', UserSchema);